package com.windbell.rest.login.impl

import windbell.domain.common.IHospitalContextService
import org.springframework.stereotype.Service
import edu.fudan.langlab.domain.security.ISystemUserService
import org.springframework.beans.factory.annotation.Autowired
import windbell.domain.user.CCHospitalUser

@Service
class HospitalContextServiceImpl implements IHospitalContextService {
	@Autowired
	private ISystemUserService systemUserService
	override getHospitalContext() {
		val curUser = systemUserService.currentUser
		switch(curUser){
			CCHospitalUser:{
				curUser.hospital
			}
			default:{
				//TODO for platform user, should use the context selected from corner combobox
				null
			}
		}
	}
	
}